<?php
// 后台路由组
Route::group('admin', function () {
    // 登录相关
    Route::post('login', 'admin/Login/login');
    Route::post('logout', 'admin/Login/logout');
    
    // 需要登录验证的路由
    Route::group('', function () {
        // 用户管理
        Route::get('user/list', 'admin/User/list');
        Route::post('user/add', 'admin/User/add');
        Route::post('user/edit', 'admin/User/edit');
        Route::post('user/delete', 'admin/User/delete');
        
        // 分类管理
        Route::get('category/list', 'admin/Categories/list');
        Route::post('category/add', 'admin/Categories/add');
        Route::post('category/edit', 'admin/Categories/edit');
        Route::post('category/delete', 'admin/Categories/delete');
        
        // 模板管理
        Route::get('template/list', 'admin/Template/list');
        Route::post('template/add', 'admin/Template/add');
        Route::post('template/edit', 'admin/Template/edit');
        Route::post('template/delete', 'admin/Template/delete');
        
        // 发布管理
        Route::get('release/list', 'admin/Release/list');
        Route::post('release/audit', 'admin/Release/audit');
        Route::post('release/delete', 'admin/Release/delete');
        
        // 详情管理
        Route::get('details/info', 'admin/Details/info');
        Route::post('details/update', 'admin/Details/update');
        
        // 统计相关
        Route::get('statistics/overview', 'admin/Statistics/overview');
        Route::get('statistics/trend', 'admin/Statistics/trend');
        
        // 上传相关
        Route::post('upload/image', 'admin/Upload/image');
        Route::post('upload/video', 'admin/Upload/video');
        
    })->middleware(['CheckAdmin']);
});

// API路由组
Route::group('api', function () {
    // 用户相关
    Route::post('user/login', 'api/User/login');
    Route::post('user/register', 'api/User/register');
    Route::get('user/info', 'api/User/info');
    Route::post('user/update', 'api/User/update');
    
    // 视频相关
    Route::get('video/list', 'api/Video/list');
    Route::get('video/detail', 'api/Video/detail');
    Route::post('video/upload', 'api/Video/upload');
    
    // 发布相关
    Route::get('release/list', 'api/Release/list');
    Route::post('release/submit', 'api/Release/submit');
}); 